import request from "@/utils/request";
/**
 * 获取角色列表
 */
export const getParsonasApi = (query) => {
  return request({
    method: "GET",
    url: "/sys/role",
    params: query,
  });
};

/**
 * 新增角色
 */

export const addParsonasApi = (data) => {
  return request({
    method: "POST",
    url: "/sys/role",
    data,
  });
};
/**
 * 删除角色
 */
export const delParsonasApi = (id) => {
  return request({
    method: "DELETE",
    url: `/sys/role/${id}`,
  });
};

/**
 * 获取角色详情
 */
export const getRolesParsonasApi = (id) => {
  return request({
    method: "GET",
    url: `/sys/role/${id}`,
  });
};

/**
 * 修改角色
 */

export const updatedParsonasApi = (data) => {
  return request({
    method: "PUT",
    url: `/sys/role/${data.id}`,
    data,
  });
};
/**
 * 获取公司详情
 */
export const getCompanyDetailApi = (id) => {
  return request({
    method: "GET",
    url: `/company/${id}`,
  });
};

/**
 * 分配权限给角色
 */
export const putPermParsonasApi = (data) => {
  return request({
    method: "PUT",
    url: "/sys/role/assignPrem",
    data,
  });
};
